package tu.java.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class DateUtils {
	
	
	
	/** Date in format 'yyyy-MM-dd' */
	public static SimpleDateFormat sdfYMD() {
		return new SimpleDateFormat("yyyy-MM-dd");
	}
	
	
	
	/** Date and Time in format 'yyyy-MM-dd HH:mm:ss' */
	public static SimpleDateFormat sdfYMD_HMS() {
		return new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss");
	}
	
	/** Date and Time in format 'yyyy-MM-dd HH:mm' */
	public static SimpleDateFormat sdfYMD_HM() {
		return new SimpleDateFormat("yyyy-MM-dd' 'HH:mm");
	}
	
	
	/** Date ant Time in format 'dd.MM.yyyy HH:mm' */
	public static SimpleDateFormat sdfDMY_HM() {
		return new SimpleDateFormat("dd.MM.yyyy' 'HH:mm");
	}
	
	
	
	/** Date in format 'dd.MM.yyyy' */
	public static SimpleDateFormat sdfDMY() {
		return new SimpleDateFormat("dd.MM.yyyy");
	}
	
	
	
	/** Time in format 'HH:mm' */
	public static SimpleDateFormat sdfHM() {
		return new SimpleDateFormat("HH:mm");
	}
	
	
	
	public static String getTimeNow() {
		Calendar c = Calendar.getInstance();
		SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
		return sdf.format(c.getTime());
	}
}
